package com.wms.util;

import java.security.MessageDigest;
import java.util.Base64;

/**
 * ---Do First---
 *
 * @author:wellseasun
 * @date:2025/5/8 下午 9:08
 * @desc:
 */
public class PwdEncrypt {
    public static String hashPassword(String password) throws Exception {
        MessageDigest digest = MessageDigest.getInstance("SHA-256");
        digest.update(password.getBytes());

        // 获取哈希值
        byte[] hash = digest.digest();
        return Base64.getEncoder().encodeToString(hash);
    }
}
